<?php
namespace app\admin\middleware;

use \think\Request;

class Auth
{
    public function handle(Request $request, \Closure $next)
    {
        $controller = $request->controller(true);
        if($controller == 'index'){
            return $next($request);
        }

        if(!session('?admin_user')){
            return redirect('/admin/index/index');
        }

        return $next($request);
    }
}